#include <iostream>
using namespace std;
int main()
{int i,j,k,l,n;
 int a[10000];
 for (n=1;n<10000;n++)
    {i=n%10;
     j=n/10%10;
     k=n/10/10%10;
     l=n/10/10/10%10;
     a[n]=n+i+j+k+l;
     }
 int t=0; 
 for (int j=1;j<=10000;j++)
    {for (int i=1;i<=10000-j;i++)
       if(a[i]>=a[i+1])
       {t=a[i];a[i]=a[i+1];a[i+1]=t;}
     }
 int h=1;
 for (int i=1;i<10000;i++)
   {if (a[h]==a[h+1])  h+=1;
    if (i!=a[h]) cout<<i<<endl;
    else h+=1;
    }
 system ("pause");
 return 0;
}

 

